package com.dream.keigezhushou.Activity.acty.personal;

import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.dream.keigezhushou.Activity.BaseActivity;
import com.dream.keigezhushou.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SettingActivity extends BaseActivity implements View.OnClickListener{

    @BindView(R.id.iv_return)
    ImageView ivReturn;
    @BindView(R.id.rl_change_pass)
    RelativeLayout rlChangePass;
    @BindView(R.id.rl_update)
    RelativeLayout rlUpdate;
    @BindView(R.id.rl_clear)
    RelativeLayout rlClear;
    @BindView(R.id.rl_advice)
    RelativeLayout rlAdvice;
    @BindView(R.id.rl_about)
    RelativeLayout rlAbout;
    @BindView(R.id.btn_exist)
    Button btnExist;
    private Intent intent;
    private Toast toast;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);

        initData();
    }

    //初始化数据
    protected void initData(){

        ivReturn.setOnClickListener(this);
        rlChangePass.setOnClickListener(this);
        rlUpdate.setOnClickListener(this);
        rlAdvice.setOnClickListener(this);
        rlClear.setOnClickListener(this);
    }


    //点击事件的实现

    @Override
    public void onClick(View view) {

        switch (view.getId()){

            case R.id.iv_return:
                finish();
                break;

            case R.id.rl_change_pass:

                //修改密码
                intent = new Intent(this,AlterPassActivity.class);
                startActivity(intent);
                break;

            case R.id.rl_update:

//                toast = new Toast(this);
//                toast.setGravity(Gravity.CENTER,0,0);
//                toast.setDuration(Toast.LENGTH_SHORT);
//                toast.show();
                Toast.makeText(this,"当前已是最新版本", Toast.LENGTH_SHORT).show();
                break;

            case R.id.rl_advice:

                //意见反馈
                intent = new Intent(this,FeedBackActivity.class);
                startActivity(intent);
                break;

            case R.id.rl_clear:

//                toast = new Toast(this);
//                toast.setText("已清除缓存");
//                toast.setGravity(Gravity.CENTER,0,0);
//                toast.setDuration(Toast.LENGTH_SHORT);
//                toast.show();
                Toast.makeText(this,"已清除缓存", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
